<template>
	<view>
		<view id="_toast" v-if="data._toast">
			<view :class="[data._toast.hide?'hide':'']" id="_toast_title">
				<text>{{data._toast.title}}</text>
			</view>
		</view>
		<view class=" flex-row flex-x-center flex-y-center" id="_loading" v-if="data._loading">
			<view :class="[data._loading?'hide':'']">
				<image :src="data.__wxapp_img.system.loading2.url"></image>
			</view>
		</view>
		<view class="new-modal" v-if="data.user_info_show">
			<view class="new-modal-content">
				<view class="new-modal-header" style="padding:30upx 0;line-height:60upx;border-bottom: 1upx solid #eee;">需要您的授权</view>
				<view class="new-modal-body" style="min-height:0;margin-bottom:0;max-height:none">
					<view style="padding:32upx 0 0 0;text-align: center">
						<view>为了提供更好的服务</view>
						<view>请在稍后的提示框中点击“允许”</view>
					</view>
					<view style="text-align:center" v-if="data.__platform=='wx'">
						<image src="/static/images/icon-login-index.png" style="width:500upx;height:460upx;"></image>
					</view>
					<view class="flex-x-center">
						<view>
							<button @getuserinfo="$emit('getUserInfo',$event)" @tap="$emit('myLogin',$event)" class="btn new-modal-btn" openType="getUserInfo" style="background-color:#04be01;width:500upx;height:80upx;border-radius:80upx;color:#fff;margin-bottom:40upx;">我知道了</button>
						</view>
					</view>
				</view>
			</view>
		</view>
		<block v-if="data.user_bind_show&&data.__user_info!=undefined">
			<view class="new-modal" v-if="!data.__user_info.binding&&data.dapp.option.phone_auth==1">
				<view class="new-modal-content">
					<view class="new-modal-header" style="padding:30upx 0;line-height:60upx;font-size:11pt;border-bottom: 1upx solid #eee;">授权获取手机号</view>
					<view class="new-modal-body" style="min-height:0;margin-bottom:0;">
						<view style="padding:32upx 0 40upx 0;text-align: center">
							<image :src="data.__wxapp_img.system.wechatapp.url" style="width: 88upx;height: 88upx;" v-if="data.__platform=='wx'"></image>
							<image :src="data.__wxapp_img.system.alipay.url" style="width: 88upx;height: 88upx;" v-else></image>
						</view>
						<view style="padding:0 41upx;">
							<view class="flex-x-center" style="margin-bottom:40upx;">申请获取您微信绑定的手机号</view>
						</view>
						<view class="flex-x-center">
							<view>
								<button @getphonenumber="$emit('getPhoneNumber',$event)" class="btn new-modal-btn" hoverClass="none" openType="getPhoneNumber"
								 style="background-color:#04be01;width:500upx;height:80upx;border-radius:80upx;color:#fff;margin-bottom:40upx;">确认</button>
							</view>
						</view>
					</view>
				</view>
			</view>
		</block>
	</view>
</template>
<script>var myVue = {};
	export default {
		props:['data'],
		methods:{
		}
	}
</script>
<style scoped>
	#_toast {
			position: fixed;
			top: calc(20% + var(--window-top));
			left: 0;
			width: 100%;
			height: 0;
			background: #ff0;
			z-index: 10000;
			padding: 0 120upx;
			text-align: center;
		}
	
		#_toast_title {
			font-size: 11pt;
			display: inline-block;
			background: rgba(0, 0, 0, 0.85);
			color: #fff;
			margin: 0 auto;
			padding: 16upx 32upx;
			border-radius: 16upx;
			max-height: 60vh;
			overflow-y: auto;
			overflow-x: hidden;
			text-align: left;
			transition: 150ms;
			word-break: break-all;
			box-shadow: 0 0 25upx 5upx rgba(0, 0, 0, 0.5);
		}
	
		#_toast_title.hide {
			opacity: 0;
			visibility: hidden;
		}
	
		#_loading {
			position: fixed;
			top: var(--window-top);
			left: 0;
			width: 100%;
			height: 100%;
			background: #fff;
			z-index: 10000;
		}
	
		#_loading image {
			width: 200upx;
			height: 200upx;
		}
</style>
